From 4b84f52ce8bbfcd5de99d2c1955e74df1506b50c Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 26 Aug 2004 14:59:55 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.107 (412dfaebCIngUElp8LanU3kSkz3C7Q) Grant-table skeleton in Xen/Linux. --- .rootkeys | 2 + .../arch/xen/kernel/Makefile | 4 +- linux-2.4.27-xen-sparse/mkbuildtree | 2 + .../arch/xen/kernel/Makefile | 3 +- .../arch/xen/kernel/gnttab.c | 46 +++++++++++++++++++ .../include/asm-xen/gnttab.h | 35 ++++++++++++++ 6 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c create mode 100644 linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h diff --git a/.rootkeys b/.rootkeys index 78f0158385..9c4ba32482 100644 --- a/.rootkeys +++ b/.rootkeys @@ -169,6 +169,7 @@ 40f56239pYRq5yshPTkv3ujXKc8K6g linux-2.6.7-xen-sparse/arch/xen/kernel/empty.c 40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c 4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6.7-xen-sparse/arch/xen/kernel/fixup.c +412dfae9eA3_6e6bCGUtg1mj8b56fQ linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c 40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.7-xen-sparse/arch/xen/kernel/process.c 40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c 3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c @@ -238,6 +239,7 @@ 40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/xor.h 40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.7-xen-sparse/include/asm-xen/ctrl_if.h 40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h +412dfaeazclyNDM0cpnp60Yo4xulpQ linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h 40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h 40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6.7-xen-sparse/include/asm-xen/multicall.h 3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.7-xen-sparse/include/asm-xen/proc_cmd.h diff --git a/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile b/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile index 02634ec4c2..3ad868e357 100644 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile @@ -6,12 +6,12 @@ all: kernel.o head.o init_task.o O_TARGET := kernel.o -export-objs := i386_ksyms.o +export-objs := i386_ksyms.o gnttab.o obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \ i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \ - reboot.o fixup.o + reboot.o fixup.o gnttab.o ifdef CONFIG_PCI obj-y += pci-i386.o pci-pc.o diff --git a/linux-2.4.27-xen-sparse/mkbuildtree b/linux-2.4.27-xen-sparse/mkbuildtree index ca407be27d..eddff3d035 100755 --- a/linux-2.4.27-xen-sparse/mkbuildtree +++ b/linux-2.4.27-xen-sparse/mkbuildtree @@ -206,6 +206,7 @@ ln -sf ../asm-i386/user.h ln -sf ../asm-i386/vm86.h ln -sf ../../${LINUX_26}/include/asm-xen/ctrl_if.h ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h +ln -sf ../../${LINUX_26}/include/asm-xen/gnttab.h ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h ln -sf ../../${LINUX_26}/include/asm-xen/proc_cmd.h @@ -223,6 +224,7 @@ ln -sf ../../i386/kernel/sys_i386.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/ctrl_if.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/evtchn.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/fixup.c +ln -sf ../../../${LINUX_26}/arch/xen/kernel/gnttab.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile b/linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile index 49714c6bfa..d4a167e6e1 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile @@ -9,4 +9,5 @@ $(obj)/vmlinux.lds.s: arch/$(ARCH)/$(XENARCH)/kernel/vmlinux.lds.s extra-y += vmlinux.lds.s -obj-y := ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o +obj-y := ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o \ + gnttab.o diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c new file mode 100644 index 0000000000..008dfa9779 --- /dev/null +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c @@ -0,0 +1,46 @@ +/****************************************************************************** + * gnttab.c + * + * Two sets of functionality: + * 1. Granting foreign access to our memory reservation. + * 2. Accessing others' memory reservations via grant references. + * (i.e., mechanisms for both sender and recipient of grant references) + * + * Copyright (c) 2004, K A Fraser + */ + +#include +#include +#include + +EXPORT_SYMBOL(gnttab_grant_foreign_access); +EXPORT_SYMBOL(gnttab_end_foreign_access); +EXPORT_SYMBOL(gnttab_grant_foreign_transfer); +EXPORT_SYMBOL(gnttab_end_foreign_transfer); + +grant_ref_t +gnttab_grant_foreign_access( + domid_t domid, unsigned long frame, int readonly) +{ + return 0; +} + +void +gnttab_end_foreign_access( + grant_ref_t ref, int readonly) +{ +} + +grant_ref_t +gnttab_grant_foreign_transfer( + domid_t domid) +{ + return 0; +} + +unsigned long +gnttab_end_foreign_transfer( + grant_ref_t ref) +{ + return 0; +} diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h b/linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h new file mode 100644 index 0000000000..f7e6ed3f78 --- /dev/null +++ b/linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * gnttab.h + * + * Two sets of functionality: + * 1. Granting foreign access to our memory reservation. + * 2. Accessing others' memory reservations via grant references. + * (i.e., mechanisms for both sender and recipient of grant references) + * + * Copyright (c) 2004, K A Fraser + */ + +#ifndef __ASM_GNTTAB_H__ +#define __ASM_GNTTAB_H__ + +#include +#include +#include + +grant_ref_t +gnttab_grant_foreign_access( + domid_t domid, unsigned long frame, int readonly); + +void +gnttab_end_foreign_access( + grant_ref_t ref, int readonly); + +grant_ref_t +gnttab_grant_foreign_transfer( + domid_t domid); + +unsigned long +gnttab_end_foreign_transfer( + grant_ref_t ref); + +#endif /* __ASM_GNTTAB_H__ */ -- 2.30.2